/*
 * 
 */
package com.csliubo.eclipse.plugin.sqlgenerator.core.resultset;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.sql.Types;

/**
 * TODO 类描述
 * 
 * @author liubo.cs@hotmail.com
 * @version 1.0
 */
public class WikiResultSetHandler extends AbstraceResultSetHandler {

    private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd");
    private static final String           ZERO          = "0";

    @Override
    protected String getValueForNull(int type) {
        switch (type) {
            case Types.DATE:
                return dateFormatter.format(new Date());
            case Types.TIME:
                return dateFormatter.format(new Date());
            case Types.TIMESTAMP:
                return dateFormatter.format(new Date());
            case Types.DECIMAL:
                return ZERO;
            case Types.DOUBLE:
                return ZERO;
            case Types.INTEGER:
                return ZERO;
            case Types.BIGINT:
                return ZERO;
            case Types.FLOAT:
                return ZERO;
            case Types.NUMERIC:
                return ZERO;
            case Types.SMALLINT:
                return ZERO;
            case Types.REAL:
                return ZERO;
            case Types.TINYINT:
                return ZERO;
            default:
                return null;
        }
    }

}
